import Taro from '@tarojs/taro';
import { Cell } from '@nutui/nutui-react-taro';
import { View, Image } from '@tarojs/components';
import { domain2 } from '@/constant';
import './card-activity.less';
import { IUser } from '@/types/user';

const imageList = [
  `${domain2}/images/Group4932.png`,
  // `${domain2}/images/Group4922.png`,
  `${domain2}/images/Group4912.png`,
  // `${domain}/images/home-active-4.png`,
  // `${domain}/images/home-active-5.png`,
  // `${domain}/images/home-active-2.png`,
  // `${domain}/images/home-active-3.png`,
];

const urlList = [
  '/pages/dou-share-to-video/index',
  // '/pages/dou-share-text-to-video/index',
  '/pages/dou-share-video-to-text/index',
  // '/pages/activity-all-day-ticket/index',
  // '/pages/activity-blind-box/index',
  // '/pages/activity-curriculum/index',
  // '/pages/activity-cooperation/index',
];

interface IProps {
  user: IUser;
}

export default function Index(props: IProps) {
  return (
    <View className="home-card-activity">
      {imageList.map((item, index) => (
        <Cell
          key={index}
          onClick={() => Taro.navigateTo({ url: urlList[index] })}>
          {props.user?.id ? (
            <Image src={item}></Image>
          ) : (
            <View className="text-center">
              {index === 0 ? '视频生成器' : '文本生成器'}
            </View>
          )}
        </Cell>
      ))}
    </View>
  );
}
